PRA1: The Prime Job! // Advanced

 
You are sitting in room A211 in Homestead High School across from the legendary Mr. Shelby who is interviewing you to determine whether or not you are qualified to teach the art of programming to middle school students at CMS and SMS. Everything was going well until Mr. Shelby threw you a curve ball; he asked you the very same question that prevented the other candidates from being deemed fit to take the job! Mr. Shelby wanted to know how to calculate all prime numbers till a specific number, and then multiply those numbers together to obtain a single integer. However, Mr. Shelby sensed you were a special candidate and wanted to challenge you further. He then instructed you to convert the single integer you obtained by multiplying all the prime numbers, originally in base 10, to base 8.

Input Format

A single integer representing the limit to which all prime numbers must be calculated, not inclusive. (e.g. a limit of 20 means all prime numbers up to 20)

Sample Input

20

Output Format

A single integer representing the product of all prime numbers to the aforementioned limit, in base 8.

Sample Output

45000552




You must be logged in to submit a solution.